package com.hl.toolkit.server.suning.epp.demo;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class PayProperties {  
	private String propertyFileName;

    public String getString(String key) {
    	Properties props = new Properties();
    	String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();
    	path = path.substring(1);
        propertyFileName = "suning.properties";
        System.out.println("path=" + path + propertyFileName);
        try {
            InputStream in = new BufferedInputStream(new FileInputStream(path + propertyFileName));
            props.load(in);
            String value = props.getProperty(key);
            System.out.println(key + value);
            return value;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
}  